/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.OperationalLimits.impl;

import EA_Model.IEC61970.Core.impl.IdentifiedObjectImpl;

import EA_Model.IEC61970.Domain.ActivePower;
import EA_Model.IEC61970.Domain.ReactivePower;

import EA_Model.IEC61970.OperationalLimits.BranchGroup;
import EA_Model.IEC61970.OperationalLimits.OperationalLimitsPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Branch Group</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.OperationalLimits.impl.BranchGroupImpl#getMaximumActivePower <em>Maximum Active Power</em>}</li>
 *   <li>{@link EA_Model.IEC61970.OperationalLimits.impl.BranchGroupImpl#getMaximumReactivePower <em>Maximum Reactive Power</em>}</li>
 *   <li>{@link EA_Model.IEC61970.OperationalLimits.impl.BranchGroupImpl#getMinimumActivePower <em>Minimum Active Power</em>}</li>
 *   <li>{@link EA_Model.IEC61970.OperationalLimits.impl.BranchGroupImpl#getMinimumReactivePower <em>Minimum Reactive Power</em>}</li>
 *   <li>{@link EA_Model.IEC61970.OperationalLimits.impl.BranchGroupImpl#getMonitorActivePower <em>Monitor Active Power</em>}</li>
 *   <li>{@link EA_Model.IEC61970.OperationalLimits.impl.BranchGroupImpl#getMonitorReactivePower <em>Monitor Reactive Power</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class BranchGroupImpl extends IdentifiedObjectImpl implements BranchGroup {
	/**
	 * The cached value of the '{@link #getMaximumActivePower() <em>Maximum Active Power</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMaximumActivePower()
	 * @generated
	 * @ordered
	 */
	protected ActivePower maximumActivePower;

	/**
	 * The cached value of the '{@link #getMaximumReactivePower() <em>Maximum Reactive Power</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMaximumReactivePower()
	 * @generated
	 * @ordered
	 */
	protected ReactivePower maximumReactivePower;

	/**
	 * The cached value of the '{@link #getMinimumActivePower() <em>Minimum Active Power</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMinimumActivePower()
	 * @generated
	 * @ordered
	 */
	protected ActivePower minimumActivePower;

	/**
	 * The cached value of the '{@link #getMinimumReactivePower() <em>Minimum Reactive Power</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMinimumReactivePower()
	 * @generated
	 * @ordered
	 */
	protected ReactivePower minimumReactivePower;

	/**
	 * The cached value of the '{@link #getMonitorActivePower() <em>Monitor Active Power</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMonitorActivePower()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Boolean monitorActivePower;

	/**
	 * The cached value of the '{@link #getMonitorReactivePower() <em>Monitor Reactive Power</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMonitorReactivePower()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Boolean monitorReactivePower;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected BranchGroupImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return OperationalLimitsPackage.Literals.BRANCH_GROUP;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ActivePower getMaximumActivePower() {
		if (maximumActivePower != null && maximumActivePower.eIsProxy()) {
			InternalEObject oldMaximumActivePower = (InternalEObject)maximumActivePower;
			maximumActivePower = (ActivePower)eResolveProxy(oldMaximumActivePower);
			if (maximumActivePower != oldMaximumActivePower) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_ACTIVE_POWER, oldMaximumActivePower, maximumActivePower));
			}
		}
		return maximumActivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ActivePower basicGetMaximumActivePower() {
		return maximumActivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMaximumActivePower(ActivePower newMaximumActivePower) {
		ActivePower oldMaximumActivePower = maximumActivePower;
		maximumActivePower = newMaximumActivePower;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_ACTIVE_POWER, oldMaximumActivePower, maximumActivePower));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ReactivePower getMaximumReactivePower() {
		if (maximumReactivePower != null && maximumReactivePower.eIsProxy()) {
			InternalEObject oldMaximumReactivePower = (InternalEObject)maximumReactivePower;
			maximumReactivePower = (ReactivePower)eResolveProxy(oldMaximumReactivePower);
			if (maximumReactivePower != oldMaximumReactivePower) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_REACTIVE_POWER, oldMaximumReactivePower, maximumReactivePower));
			}
		}
		return maximumReactivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ReactivePower basicGetMaximumReactivePower() {
		return maximumReactivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMaximumReactivePower(ReactivePower newMaximumReactivePower) {
		ReactivePower oldMaximumReactivePower = maximumReactivePower;
		maximumReactivePower = newMaximumReactivePower;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_REACTIVE_POWER, oldMaximumReactivePower, maximumReactivePower));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ActivePower getMinimumActivePower() {
		if (minimumActivePower != null && minimumActivePower.eIsProxy()) {
			InternalEObject oldMinimumActivePower = (InternalEObject)minimumActivePower;
			minimumActivePower = (ActivePower)eResolveProxy(oldMinimumActivePower);
			if (minimumActivePower != oldMinimumActivePower) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_ACTIVE_POWER, oldMinimumActivePower, minimumActivePower));
			}
		}
		return minimumActivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ActivePower basicGetMinimumActivePower() {
		return minimumActivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMinimumActivePower(ActivePower newMinimumActivePower) {
		ActivePower oldMinimumActivePower = minimumActivePower;
		minimumActivePower = newMinimumActivePower;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_ACTIVE_POWER, oldMinimumActivePower, minimumActivePower));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ReactivePower getMinimumReactivePower() {
		if (minimumReactivePower != null && minimumReactivePower.eIsProxy()) {
			InternalEObject oldMinimumReactivePower = (InternalEObject)minimumReactivePower;
			minimumReactivePower = (ReactivePower)eResolveProxy(oldMinimumReactivePower);
			if (minimumReactivePower != oldMinimumReactivePower) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_REACTIVE_POWER, oldMinimumReactivePower, minimumReactivePower));
			}
		}
		return minimumReactivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ReactivePower basicGetMinimumReactivePower() {
		return minimumReactivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMinimumReactivePower(ReactivePower newMinimumReactivePower) {
		ReactivePower oldMinimumReactivePower = minimumReactivePower;
		minimumReactivePower = newMinimumReactivePower;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_REACTIVE_POWER, oldMinimumReactivePower, minimumReactivePower));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean getMonitorActivePower() {
		if (monitorActivePower != null && monitorActivePower.eIsProxy()) {
			InternalEObject oldMonitorActivePower = (InternalEObject)monitorActivePower;
			monitorActivePower = (EA_Model.IEC61970.Domain.Boolean)eResolveProxy(oldMonitorActivePower);
			if (monitorActivePower != oldMonitorActivePower) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OperationalLimitsPackage.BRANCH_GROUP__MONITOR_ACTIVE_POWER, oldMonitorActivePower, monitorActivePower));
			}
		}
		return monitorActivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean basicGetMonitorActivePower() {
		return monitorActivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMonitorActivePower(EA_Model.IEC61970.Domain.Boolean newMonitorActivePower) {
		EA_Model.IEC61970.Domain.Boolean oldMonitorActivePower = monitorActivePower;
		monitorActivePower = newMonitorActivePower;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OperationalLimitsPackage.BRANCH_GROUP__MONITOR_ACTIVE_POWER, oldMonitorActivePower, monitorActivePower));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean getMonitorReactivePower() {
		if (monitorReactivePower != null && monitorReactivePower.eIsProxy()) {
			InternalEObject oldMonitorReactivePower = (InternalEObject)monitorReactivePower;
			monitorReactivePower = (EA_Model.IEC61970.Domain.Boolean)eResolveProxy(oldMonitorReactivePower);
			if (monitorReactivePower != oldMonitorReactivePower) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OperationalLimitsPackage.BRANCH_GROUP__MONITOR_REACTIVE_POWER, oldMonitorReactivePower, monitorReactivePower));
			}
		}
		return monitorReactivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Boolean basicGetMonitorReactivePower() {
		return monitorReactivePower;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMonitorReactivePower(EA_Model.IEC61970.Domain.Boolean newMonitorReactivePower) {
		EA_Model.IEC61970.Domain.Boolean oldMonitorReactivePower = monitorReactivePower;
		monitorReactivePower = newMonitorReactivePower;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OperationalLimitsPackage.BRANCH_GROUP__MONITOR_REACTIVE_POWER, oldMonitorReactivePower, monitorReactivePower));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_ACTIVE_POWER:
				if (resolve) return getMaximumActivePower();
				return basicGetMaximumActivePower();
			case OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_REACTIVE_POWER:
				if (resolve) return getMaximumReactivePower();
				return basicGetMaximumReactivePower();
			case OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_ACTIVE_POWER:
				if (resolve) return getMinimumActivePower();
				return basicGetMinimumActivePower();
			case OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_REACTIVE_POWER:
				if (resolve) return getMinimumReactivePower();
				return basicGetMinimumReactivePower();
			case OperationalLimitsPackage.BRANCH_GROUP__MONITOR_ACTIVE_POWER:
				if (resolve) return getMonitorActivePower();
				return basicGetMonitorActivePower();
			case OperationalLimitsPackage.BRANCH_GROUP__MONITOR_REACTIVE_POWER:
				if (resolve) return getMonitorReactivePower();
				return basicGetMonitorReactivePower();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_ACTIVE_POWER:
				setMaximumActivePower((ActivePower)newValue);
				return;
			case OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_REACTIVE_POWER:
				setMaximumReactivePower((ReactivePower)newValue);
				return;
			case OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_ACTIVE_POWER:
				setMinimumActivePower((ActivePower)newValue);
				return;
			case OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_REACTIVE_POWER:
				setMinimumReactivePower((ReactivePower)newValue);
				return;
			case OperationalLimitsPackage.BRANCH_GROUP__MONITOR_ACTIVE_POWER:
				setMonitorActivePower((EA_Model.IEC61970.Domain.Boolean)newValue);
				return;
			case OperationalLimitsPackage.BRANCH_GROUP__MONITOR_REACTIVE_POWER:
				setMonitorReactivePower((EA_Model.IEC61970.Domain.Boolean)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_ACTIVE_POWER:
				setMaximumActivePower((ActivePower)null);
				return;
			case OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_REACTIVE_POWER:
				setMaximumReactivePower((ReactivePower)null);
				return;
			case OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_ACTIVE_POWER:
				setMinimumActivePower((ActivePower)null);
				return;
			case OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_REACTIVE_POWER:
				setMinimumReactivePower((ReactivePower)null);
				return;
			case OperationalLimitsPackage.BRANCH_GROUP__MONITOR_ACTIVE_POWER:
				setMonitorActivePower((EA_Model.IEC61970.Domain.Boolean)null);
				return;
			case OperationalLimitsPackage.BRANCH_GROUP__MONITOR_REACTIVE_POWER:
				setMonitorReactivePower((EA_Model.IEC61970.Domain.Boolean)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_ACTIVE_POWER:
				return maximumActivePower != null;
			case OperationalLimitsPackage.BRANCH_GROUP__MAXIMUM_REACTIVE_POWER:
				return maximumReactivePower != null;
			case OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_ACTIVE_POWER:
				return minimumActivePower != null;
			case OperationalLimitsPackage.BRANCH_GROUP__MINIMUM_REACTIVE_POWER:
				return minimumReactivePower != null;
			case OperationalLimitsPackage.BRANCH_GROUP__MONITOR_ACTIVE_POWER:
				return monitorActivePower != null;
			case OperationalLimitsPackage.BRANCH_GROUP__MONITOR_REACTIVE_POWER:
				return monitorReactivePower != null;
		}
		return super.eIsSet(featureID);
	}

} //BranchGroupImpl
